Skip to content

Conversation

@delatrie
Copy link
Contributor

Context

This PR adds a new property called titlePath to TestResult and makes Allure NUnit, Allure xUnit.net, Allure SpecFlow, and Allure.Reqnroll fill it.

More about titlePath: allure-framework/allure-js#1260.

NUnit

For an NUnit test, the titlePath follows the NUnit ITest hierarchy. Only nodes at the TestSuite level or higher are translated into titlePath.

Example:

Given a test assembly called MyTestAssembly and the following code:

using NUnit.Framework;

namespace Foo.Bar;

class Baz
{
    [Test]
    public void Qux() { }

    [TestCase(1)]
    public void Qut(int _) { }
}

The titlePath of both tests will be as follows:

[
  "MyTestAssembly", // the assembly name
  "Foo",  // the namespace
  "Bar", // the namespace
  "Baz", // the test class
]

The test class part can be renamed from code via the TestFixture.TestName property.

xUnit.net

For xUnit.net tests, the titlePath is defined by the tests' declaring type (a test class). It contains the assembly name, namespace elements, and the class name.

Reqnroll and SpecFlow

For Reqnroll and SpecFlow tests, the titlePath contains the assembly name, the parent directories of the feature file inside the assembly, and the feature name. If the feature is nameless, the Feature placeholder is used instead.

Checklist

@delatrie delatrie changed the title feat: titlePath feat(nunit, xunit, specflow, reqnroll): titlePath Aug 11, 2025
@delatrie delatrie requested a review from epszaw August 11, 2025 14:58
@delatrie delatrie merged commit 9293efa into main Aug 11, 2025
7 checks passed
@delatrie delatrie deleted the title-path branch August 11, 2025 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants